package models

import (
	"github.com/jinzhu/gorm"
	"kop/libs/database"
	"kop/modules/server/entity"
)

func AutoMigrate(dB *gorm.DB) {
	dB.AutoMigrate(new(entity.Server))
}

func GetServers() []*entity.Server {
	var data []*entity.Server
	database.DB.Where("state = ?", entity.StatusNormal).Find(&data)
	return data
}
